package mutsumimod.cards.custom;

import com.evacipated.cardcrawl.mod.stslib.cards.targeting.SelfOrEnemyTargeting;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.ArtifactPower;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.powers.AntiArtifactPower;
import mutsumimod.util.CardStats;

public class FakeMedicine extends BaseCard {
    public static final String ID = makeID(FakeMedicine.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            AbstractCard.CardType.SKILL,
            AbstractCard.CardRarity.COMMON,
            SelfOrEnemyTargeting.SELF_OR_ENEMY,
            0
    );

    public FakeMedicine() {
        super(ID, info);
        exhaust=true;
        setAttr(0,0,1);
        setAttrUpg(0,0,1);
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        AbstractCreature target = SelfOrEnemyTargeting.getTarget(this);
        if (target == null)
            target = AbstractDungeon.player;
        if(target.equals(AbstractDungeon.player)){
            applyPowerSelf(new ArtifactPower(target, magicNumber));
        }else{
            applyPowerMonster(new AntiArtifactPower(target,magicNumber),(AbstractMonster)target);
        }
    }

    @Override
    public AbstractCard makeCopy() { //Optional
        return new FakeMedicine();
    }

}
